﻿// <copyright file="PackageFileContainer.cs" company="Sinclair Community College">
// Copyright 2010 Sinclair Community College
// </copyright>
// <originalAuthor>Patrick S. Seymour (patrick.seymour@gmail.com)</originalAuthor>

namespace SinclairCC.AppV
{
    using System;

    public class PackageFileContainer : Container
    {
        /// <summary>
        /// This container points to a directory and file data block structure.
        /// This file was created by the App-V Sequencer and is part of a package.
        /// </summary>
        /// <remarks>
        /// This structure is not needed in order to extract the data of a file.
        /// </remarks>
        private PackageFileInfo packageFileInfo;

        private _SOFTFS_IND_FILE_BLOCK_ROOT_DATA dataIndexTable;

        /// <summary>
        /// Initializes a new instance of the RunFileContainer class.
        /// </summary>
        public PackageFileContainer(System.IO.BinaryReader fileReader)
            : base(fileReader)
        {
            this.ReadContainer(fileReader);
        }

        /// <summary>
        /// Reads the actual data for this container from the file.
        /// </summary>
        protected void ReadContainer(System.IO.BinaryReader fileReader)
        {
            this.packageFileInfo = new PackageFileInfo(fileReader);
            this.dataIndexTable = new _SOFTFS_IND_FILE_BLOCK_ROOT_DATA(fileReader);
        }

        public PackageFileInfo PkgFileInfo
        {
            get { return this.packageFileInfo; }
        }

        public _SOFTFS_IND_FILE_BLOCK_ROOT_DATA DataIndexTable
        {
            get { return this.dataIndexTable; }
        }
    }
}
